if [[ "$(uname -s)" == "Darwin" ]]; then
	temp_dir="$(mktemp -d)"
	target_file="$temp_dir"/fish.pkg
	curl -SsL https://gitee.com/hevey88/install_script/releases/download/4.0.2/fish-4.0.2.pkg -o "$target_file"
	sudo installer -pkg "$target_file" -target /
	rm -rf "$target_file"
	chsh -s /usr/local/bin/fish
fi

if [[ "$(uname -s)" == "Linux" ]]; then
	if type zypper &>/dev/null; then
		sudo zypper install -y fish
		exit
	fi
	if type dnf &>/dev/null; then
		sudo dnf -y install fish
	elif type apt &>/dev/null; then
		sudo apt install -y fish
	elif type mamba &>/dev/null; then
		mamba install -y fish
	fi
	chsh -s /usr/bin/fish
fi
